Open
Conversation
Contributor
|
저도 풀어봤던 문제인데, 저랑 코드 흐름이 완전 똑같네요..ㅋㅋ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. 키로거
🔗 문제 링크
https://www.acmicpc.net/problem/5397
✔️ 소요된 시간
30분
✨ 수도 코드
시도 1. 전체 리스트의 요소를 하나씩 방문하며 결과 리스트의 인덱스를 커서처럼 이용해 결과 출력 만들기
lis : 입력값 저장
result : 출력값 저장
idx : result의 인덱스, 커서처럼 동작
반복문을 이용해 lis의 요소를 하나하나 검사하며 idx(커서)를 이동시킴.
lis의 요소중 문자가 나오면 result의 idx에 삽입
문제점 -> insert()가 시간이 너무 많이 걸림
시도 2. left, right 리스트를 이용해 결과 생성
idx(커서)를 직접 이동시키는 대신, 커서의 왼쪽과 오른쪽을 각각 lis로 만들어 문자요소들을 이동시킨다.
📚 새롭게 알게된 내용